#!/usr/bin/python
# -*- coding: utf-8 -*-

import re
import sys

# decode HTML entities
from htmlentitydefs import name2codepoint
def htmlentitydecode(s):
    s = s.replace('&nbsp;', ' ')
    return re.sub('&(%s);' % '|'.join(name2codepoint),
                  lambda m: unichr(name2codepoint[m.group(1)]), s)

# remove HTML tags
def detag(s):
    return re.sub('<.*?>', '', s)

# strip accents from text
import unicodedata
def strip_accents(text, encoding):
    unicode_text = unicodedata.normalize("NFKD", text.decode(encoding))
    return filter(lambda x: not unicodedata.combining(x),
                  unicode_text).encode(encoding)

# return formated date (given it's '02/06/2010', returns '2/6')
import datetime
def format_date():
    return datetime.date.today().strftime('%-d/%-m')

# remove double/triple/... spacing
def remove_double_spaces(s):
    return re.sub('\s+', ' ', s)


def main():
    # read text from standard input (which must be in UTF-8)
    html = sys.stdin.readlines()

    # select cardapio from html
    cardapio = []
    start = False
    for line in html:
        line = line.strip()
        if line == '<!-- DESCRIÇÃO -->':
            start = True
            continue
        if line == '<!-- LICITAÇÕES -->':
            break
        if start:
            cardapio.append(line)

    for line in cardapio:
        # detag text, and decode html entities
        line = detag(line)
        line = htmlentitydecode(line)

        # everything in UPPERCASE from now
        line = line.upper()

        # remove unnecessary things, adjust encoding, and remove accents
        line = remove_double_spaces(line)
        line = strip_accents(line.encode('utf-8'), 'utf-8')
        line = line.strip(' .,;')
        line = line.replace(' DE ', ' ')

        # ignore some lines, to shorten message
        if line.find('ARROZ')!=-1 and line.find('FEIJAO')!=-1:
            continue
        if line.startswith('SALADA') or line.startswith('PTS') or line.find('GLUTEN')!=-1 or line.find('LACTOSE')!=-1:
            continue
        if line == '':
            continue

        # reached end of cardapio, ignore the following lines
        if line.startswith('OBS.:') or line.startswith('OBS:') or line.startswith('OBSERVACAO:') or line.startswith('BOM APETITE'):
            break

        # if there is a ':', ignore preceding text
        # (in 'PRATO PRINCIPAL: LINGUICA FRITA', 'LINGUICA FRITA' is what really matters)
        line_aux = line.partition(':')
        if line_aux[1] != '':
            line = line_aux[2].strip()

        # if text starts with 'ALMOCO' or 'JANTAR', shorten it
        # (given 'JANTAR- 02/06/2010 - QUARTA-FEIRA', i'd like to have 'JANTAR 2/6')
        if line.startswith('ALMOCO') or line.startswith('JANTAR'):
            line = line.split('-')[0].strip() + ' ' + format_date()

        # capitalize to make text more beautiful
        line = line.capitalize()
        print line


if __name__ == '__main__':
    main()
